package jp.sourceforge.akjrcp.util;

import org.eclipse.ui.PlatformUI;

public class AvisynthUtils {
	public static final String USE_AVISOURCE="avisynth.use_avisource";
	
	public static final String WMV_FPS="avisynth.wmv_fps";
	public static String getAvisynthScript(String path){
		boolean useAvisource=PlatformUI.getPreferenceStore().getBoolean(USE_AVISOURCE);
		double wmvFps=PlatformUI.getPreferenceStore().getDouble(WMV_FPS);
		
		String ext=FileNameUtils.getExtension(path);
		if(ext.toLowerCase().equals("wmv")){
			return "DirectShowSource(\""+path+"\""+",convertfps=true, fps="+wmvFps+")";
		}else{
		if(!useAvisource){
			 return "DirectShowSource(\""+path+"\")";
		}else{
			
			if(ext.toLowerCase().equals("avi")){
				return "AviSource(\""+path+"\")";
			}else{
				return "DirectShowSource(\""+path+"\")";
			}
		}
		}
	}
}
